/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Dialog_Objetivo_PlanGeneral.java
 *
 * Created on 01-07-2009, 10:40:45 PM
 */

package vista.admin;

/**
 *
 * @author Felipe_2
 */
public class Dialog_Objetivo_PlanGeneral extends javax.swing.JDialog {

    private String objetivo;

    /** Creates new form Dialog_Objetivo_PlanGeneral
     * @param parent
     * @param modal
     * @param titulo
     */
    public Dialog_Objetivo_PlanGeneral(java.awt.Frame parent, boolean modal, String titulo, String objetivo) {
        super(parent, modal);
        initComponents();
        setTitle(titulo);
        this.objetivo = objetivo;
        this.edpEditorObjetivo.setText(this.getObjetivo());
    }

   
    public void setObjetivo() {
        this.objetivo = edpEditorObjetivo.getText();
        this.dispose();
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        scrEditorObjetivo = new javax.swing.JScrollPane();
        edpEditorObjetivo = new javax.swing.JEditorPane();
        btnEditarObjetivo = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(495, 210));
        setName("Form"); // NOI18N
        setResizable(false);

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(semillas_609_dev.Semillas_609_devApp.class).getContext().getResourceMap(Dialog_Objetivo_PlanGeneral.class);
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel1.border.title"))); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N

        scrEditorObjetivo.setName("scrEditorObjetivo"); // NOI18N

        edpEditorObjetivo.setBorder(null);
        edpEditorObjetivo.setDebugGraphicsOptions(javax.swing.DebugGraphics.BUFFERED_OPTION);
        edpEditorObjetivo.setName("edpEditorObjetivo"); // NOI18N
        scrEditorObjetivo.setViewportView(edpEditorObjetivo);

        btnEditarObjetivo.setText(resourceMap.getString("btnEditarObjetivo.text")); // NOI18N
        btnEditarObjetivo.setName("btnEditarObjetivo"); // NOI18N
        btnEditarObjetivo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditarObjetivoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(scrEditorObjetivo, javax.swing.GroupLayout.PREFERRED_SIZE, 641, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(604, Short.MAX_VALUE)
                .addComponent(btnEditarObjetivo)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(scrEditorObjetivo, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnEditarObjetivo))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnEditarObjetivoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditarObjetivoActionPerformed
        setObjetivo();
    }//GEN-LAST:event_btnEditarObjetivoActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                Dialog_Objetivo_PlanGeneral dialog = new Dialog_Objetivo_PlanGeneral(new javax.swing.JFrame(), true,"","");
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnEditarObjetivo;
    private javax.swing.JEditorPane edpEditorObjetivo;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane scrEditorObjetivo;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the objetivo
     */
    public String getObjetivo() {
        return objetivo;
    }

}
